package com.honey.compilation.sql.ddl;

import com.honey.compilation.sql.SqlKeyWord;
import com.honey.compilation.sql.SqlScript;
import com.honey.core.builder.CharacterBuilder;
import com.honey.core.builder.CharacterBuilderFactory;
import com.honey.core.compiler.CompilationException;
import com.honey.core.utils.StringUtility;


/**
 * Set命令 SET NAMES 命令<br />
 *  <set names statement>    ::=   SET NAMES <value specification>
 * @author Administrator
 *
 */
public class SetNames extends Set implements SqlScript{
	
	
	private String append= null;
	public SetNames ( String append){
		this.append =append;
	}
	
	@Override
	public CharacterBuilder compiledContent(int indentLevel ) throws CompilationException{
		CharacterBuilder answer = CharacterBuilderFactory.createC16StringBuilder();
		if( StringUtility.stringHasValue(append)){
			answer.append(super.compiledContent(indentLevel))
			.append(SqlKeyWord.NAMES)
			.append(append)
			.append(SqlKeyWord.OPERATION_SEMICOLON);
		}
		return answer;
	}
}


